home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / xeno / megacd.lha / megacd / MegaREQCH.rexx < prev    next >
OS/2 REXX Batch file  |  1995-10-01  |  2KB  |  111 lines

  1. /*
  2.  *
  3.  *   MegaCReq.rexx v 1.0 ⌐ 1995 by David Huckett 3:640/800 @ Fidonet.
  4.  *
  5.  *   Used to check as a user logs on if he has requested files waiting..
  6.  *
  7.  *   Requires MegaCD and MegaRXDL by David Huckett....
  8.  *   Part of a complete CD-Rom access solution for Xenolink BBS..
  9.  *
  10. */
  11.  
  12. /*
  13.  * USAGE:   Rexx "Doors:MegaCD/MegaREQCH.rexx ~14"
  14.  *
  15. */
  16. /************* System Variables.. Change to suit yourself ******************/
  17.  
  18. BUFFERDIR     = 'Doors:MegaCD/BUFFER/' 
  19. REQPATH       = 'Doors:MegaCD/Requests/'
  20.  
  21. /****************************************************************************/
  22.  
  23. options results
  24.  
  25.  
  26. PR = 'PRINT'
  27.  
  28. arg Node
  29. host = 'XenolinkRexxPort'Node
  30. address value host
  31. signal on error
  32. signal on syntax
  33. signal on IOERR
  34.  
  35.  if ~show('L','rexxsupport.library') then do
  36.   if ~addlib('rexxsupport.library',0,-30,0) then do
  37.     PR 'Support library not available.'
  38.      call error
  39.     signal Quit
  40.    end
  41. end
  42.  
  43. getuservar name ; nicename strip(result); name = result
  44.  
  45. fullname = SPACE(name,1,_)
  46.  
  47. GETUSERVAR MENUSET 
  48. gfx=result         
  49. if gfx >='1' then do
  50.     WHI='';RED='';GRN='';BGRN='';YEL='';BYEL='';BLU='';MAJ='';CYA='';BCYA='';OFF=''
  51. END
  52.     ELSE DO
  53.     WHI='';RED='';GRN='';BGRN='';YEL='';BYEL='';BLU='';MAJ='';CYA='';OFF='';BCYA=''
  54. END
  55.  
  56.  
  57. if ~exists(REQPATH||Fullname'.fnd') then exit 0
  58.  
  59.  
  60. pr
  61. pr BGRN'MegaCD (c) David Huckett.'OFF
  62. pr
  63. pr CYA'You have requested files from CD-Roms waiting..'
  64. pr
  65. msg YEL'Do you wish to add them to your download list now? Y/N '
  66. GETCHAR
  67. ans = strip(upper(result))
  68.  
  69. if ans = 'N' then exit 0
  70. if ans = 'Y' then call ADD
  71.  
  72. exit 0
  73.  
  74. ADD:
  75.  
  76.     if ~exists('T:MRXDL'node'.sfl') Then call open(tempdl,'T:MRXDL'node'.sfl','W')
  77.     else Call open(Tempdl,'T:MRXDL'node'.sfl','A')
  78.  
  79.     Call open(rfile,REQPATH||FULLNAME'.fnd',R)
  80.     Do i = 1 Until EOF(rfile)
  81.         FILENAME.i = strip(Readln(rfile))
  82.     if filename.i = '' then leave i
  83.     Call WriteLn(Tempdl,BUFFERDIR  FILENAME.i)
  84.     end
  85.  
  86.     Call close(Tempdl)
  87.     Call close(rfile)
  88.  
  89.         address command 'DELETE 'REQPATH||FULLNAME'.fnd QUIET'
  90.  
  91. exit 0
  92.  
  93. /*************** ERROR Routine *******************/
  94. error:
  95. a = SIGL;message 'Error!!!  Line # 'a;call delay 200
  96. SysopLog 'ERROR MegaReqCH line # 'a
  97.  
  98.  
  99. EXIT 10
  100.  
  101. syntax:
  102. a = SIGL;message 'Syntax Error!!!  Line # 'a;call delay 200
  103. SysopLog 'SYNTAX ERROR MegaReqCH line # 'a
  104. EXIT 10
  105.  
  106. ioerr:
  107. message 'I/O Error!!!';call delay 200
  108. SysopLog 'IO ERROR MegaReqCH.'
  109.  
  110. EXIT 10
  111.